package main

import "fmt"

type stockPosition struct {
	ticker     string
	sharePrice float32
	count      float32
}

func (s stockPosition) getValue() float32 {
	return s.sharePrice * s.count
}

type car struct {
	make  string
	model string
	price float32
}

func (c car) getValue() float32 {
	return c.price
}

type valuable interface {
	getValue() float32
}

func showValue(asset valuable) {
	fmt.Println("Value of the asset is: ", asset.getValue())
}

func main() {
	s := stockPosition{"Beijing", 56.78, 1.40}
	showValue(s)

	var c car
	c.make = "made from china"
	c.model = "run on the road"
	c.price = 10086.00
	showValue(c)
}
